﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ContentManage.aspx.cs" Inherits="Whir_System_Module_Information_ContentManage" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5)" />
    <meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5)" />
    <link href="../../Skin/Default/Css/main.css" rel="stylesheet" type="text/css" />
    <link href="../../Skin/Default/Css/css2.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="../../UserControls/My97DatePicker/WdatePicker.js" type="text/javascript"></script><!-- 日历-->
    <script language="javascript" src="../../Js/common.js" type="text/javascript"></script>
    <script language="javascript" src="../../Js/JQuery/jquery1.3.11.pack.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="../../../Script/Validate.js"></script>
    <style type="text/css">
    tr.alt td {
            background:#ecf6fc;  /*这行将给所有的tr加上背景色*/
            color: #7B7B7B;
    }
     
    tr.over td {
            background:#bcd4ec;  /*这个将是鼠标高亮行的背景色*/
            cursor:pointer;
            color:black;
    }
    </style>

    <script language="javascript" type="text/javascript">
        if (top.location == self.location) { 
            alert('禁止访问子栏目页！将跳转到默认页面');
            top.location='../../Default.aspx';
        } 
    </script>
    
    <script language="javascript" type="text/javascript">
    function openBg(state) { //遮照打开关闭控制
     if(state == 1) {
          document.getElementById("bg").style.display = "block";
          var h = document.body.offsetHeight > document.documentElement.offsetHeight ? document.body.offsetHeight : document.documentElement.offsetHeight;
          document.getElementById("bg").style.height = h + "px";
     }
     else {
        document.getElementById("bg").style.display = "none";
     } 
    }
    
    //操作关闭打开控制
    function openSelect(state){ 
     if(state == 1)  {
        document.getElementById("selectItem").style.display = "block";
        document.getElementById("selectItem").style.left = (document.getElementById("bg").offsetWidth - document.getElementById("selectItem").offsetWidth)/2 + "px";
        document.getElementById("selectItem").style.top = document.body.scrollTop + 100 + "px";  
     }
     else {
        document.getElementById("selectItem").style.display = "none";
        //清空内容
        document.getElementById("txtColumnName").value = "";
        document.getElementById("txtUrl").value = "*";
        document.getElementById("txtSort").value = "";
     }
    }
    
    ////操作关闭打开控制
    function opendivChange(state) {
        if(state == 1)  {
        document.getElementById("divChange").style.display = "block";
        document.getElementById("divChange").style.left = (document.getElementById("bg").offsetWidth - document.getElementById("divChange").offsetWidth)/2 + "px";
        document.getElementById("divChange").style.top = document.body.scrollTop + 100 + "px";  
     }
     else {
        document.getElementById("divChange").style.display = "none";
     }
    }
    function ReloadTree() {
        parent.frames['leftmenu'].location.reload();
    }
    </script>
<style type="text/css">
<!--
body{font-size:12px;}
h2{margin:0px;padding:0px;font-size:12px;font-weight:bold;}
.bton{border:1px solid #CCC;background:#DDD;}
.cont{padding:10px;}
#main{width:400px;margin:0px auto;}
#selectItem{background:#FFF;position:absolute;top:0px;left:center;border:1px solid #000;overflow:hidden;margin-top:10px;width:500px;z-index:2;}
#divChange{background:#FFF;position:absolute;top:0px;left:center;border:1px solid #000;overflow:hidden;margin-top:10px;width:300px;z-index:2;}
#preview{margin:1px;border:1px solid #CCC;}
#result{border:1px solid #CCC;margin-top:10px;}
.tit{line-height:20px;height:20px;margin:1px;padding-left:10px;}
.bgc_ccc{background:#CCC;}
.bgc_eee{background:#eee;}
.c_999{color:#999}
.pointer{cursor:pointer;}
.left{float:left;}
.right{float:right;}
.cls{clear:both;font-size:0px;height:0px;overflow:hidden;}
#bg{background:#CCC;filter:alpha(opacity=70);opacity:0.7;width:100%;;position:absolute;left:0px;top:0px;display:none;z-index:1;}
.hidden{display:none;}
.move{cursor:move;}
-->
</style>
</head>
<body>
    <form id="form1" runat="server">
        <!--头部导航-->
        <div class="crumb">
            <span class="btn_box">&nbsp;<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="../../Skin/Default/images/icon3.jpg"
                OnClick="ImageButton2_Click" ToolTip="重新登录" />&nbsp;&nbsp;
                <img style="cursor: pointer" src="../../Skin/Default/images/icon4.jpg" border="0"
                    alt="刷新" onclick="window.location.reload();" />&nbsp;&nbsp;
                <img style="cursor: pointer" src="../../Skin/Default/images/icon5.jpg" border="0"
                    alt="后退" onclick="history.back();" />&nbsp;&nbsp;
                <img style="cursor: pointer" src="../../Skin/Default/images/icon6.jpg" border="0"
                    alt="前进" onclick="history.forward(1);" />&nbsp;&nbsp;
                <img style="cursor: pointer" src="../../Skin/Default/images/icon7.jpg" border="0"
                    alt="关于" onclick="window.open('../../../Install/EULA.html','','height=300, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no');" />&nbsp;&nbsp;
                <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="../../Skin/Default/images/icon8.jpg"
                    OnClick="ImageButton1_Click" ToolTip="退出" />
            </span>您所在的位置：<a href="../../Main.aspx">管理首页</a> &gt;&gt;
            <asp:Label ID="lbColumnName" runat="server" />
            &gt;&gt; 信息列表
        </div>
        <!--头部导航结束-->
        
        <!-- 搜索-->
        <whir:ContentSearch ID="ContentSearch1" runat="server" />
        
        <!--操作按钮-->
        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DADADA"
            style="margin: 10px 0px 10px 0px;">
            <tr>
                <td class="form_td">
                    <%--<asp:Button ID="btnSubmit" runat="server" Text="添加" CssClass="btn_default" OnClick="btnSubmit_Click" />--%>
                    <input id="btnSubmit" type="button" value="添加" class="btn_default" onclick="popWindow();" runat="server" />
                    <asp:Button ID="btnDelete" runat="server" Text="删除" CssClass="btn_default" OnClick="btnDelete_Click" OnClientClick="return confirm('确定要删除吗？');" />
                    <input id="btnAddColumn" type="button" value="栏目添加" class="btn_default" onclick="openBg(1);openSelect(1);" />
                    <input id="btnTypeChange" type="button" value="信息管理" class="btn_default" onclick="openBg(1);opendivChange(1);" />
                </td>
            </tr>
        </table>
        
        <!-- 内容管理-->
        <Whir:NewCommonContentManage id="NewCommonContentManage1" runat="server"></Whir:NewCommonContentManage>
        
        
        <div id="bg"></div>
        <!--类别管理的层-->
        <div id="selectItem" class="hidden">
            <div class="tit bgc_ccc move">
               <h2 class="left">栏目添加</h2>
               <span class="pointer right" onclick="openBg(0);openSelect(0);">[取消]</span>
              </div>
            <table border="0" align="center" cellpadding="3" cellspacing="1" width="100%">
            <tr>
                <td>类别名称:</td>
                <td>
                    <asp:TextBox ID="txtColumnName" runat="server"></asp:TextBox>
                    <span style="color: Red;">*</span>
                    <span class="form_desc">此栏目在栏目导航中的名称</span>
                </td>
            </tr>
            <tr>
                <td>静态页面名称</td>
                <td>
                    <asp:TextBox ID="txtUrl" runat="server" Width="180px" Text="*"></asp:TextBox>
                    <span style="color: Red;">*</span>
                    <span class="form_desc">此栏目生成的静态文件名称</span>
                </td>
            </tr>
            <tr>
                <td>排序:</td>
                <td>
                    <asp:TextBox ID="txtSort" runat="server" MaxLength="3" Width="60px"></asp:TextBox>
                    <span style="color: Red;">*</span>
                    <span class="form_desc">此栏目在栏目导航中的位置</span>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center;">
                    <asp:Button ID="btnAddColumnServer" runat="server" Text="确定" OnClick="btnAddColumnServer_Click" CssClass="btn_default" OnClientClick="return CheckSelectItem();" />
                </td>
            </tr>
            </table>
        </div>
        
        <!--类别转移层-->
        <div id="divChange" class="hidden">
            <div class="tit bgc_ccc move">
               <h2 class="left">信息管理</h2>
               <span class="pointer right" onclick="openBg(0);opendivChange(0);">[取消]</span>
              </div>
            <table border="0" align="center" cellpadding="3" cellspacing="1" width="100%">
            <tr>
                <td>类别:</td>
                <td>
                    <asp:DropDownList ID="dropCategroy" runat="server">
                    </asp:DropDownList>
                    <span class="form_desc">新的类别</span>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center;">
                    <asp:Button ID="btnChange" runat="server" Text="确定" OnClick="btnChange_Click" CssClass="btn_default" />
                </td>
            </tr>
            </table>
        </div>
    </form>
</body>
</html>

<!-- 初始化文本框样式-->
<script type="text/javascript">
initAutoFormStyle();
</script>

<script language="javascript" type="text/javascript">
$(document).ready(function(){
    $(".list tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");})
    $(".list tr:even").addClass("alt");
});
</script>

<script language="javascript" type="text/javascript">
var popUrl = '<%=AddUrl %>';
function popWindow(){
    window.location.href = popUrl;
}

function CheckSelectItem() {
    var vs = [
        "txtColumnName|noNull|请填写栏目名称!",
        "txtUrl|noNull|请填写静态页面名称!",
        "txtSort|noNull|请填写排序!",
        "txtSort|number|请填写排序!"];
        
    if (Validator(vs)) {
        var v1 = document.getElementById("txtUrl").value;
        if (v1 == "*.html") {
            alert("请填写静态页面名称!");
            document.getElementById("txtUrl").focus();
            return false;
        }
        else {
            return true;
        }
    }
    else {
        return false;
    }
}
</script>
